﻿<%@ include file="../include/top.jsp"%>
<%@ include file="../include/errorArea.jsp"%>
<script type="text/javascript">
<!--
function clickSS(){
	document.getElementById("Image8").click(); 
	$("#Image8").click();
}

$(document).ready(function(){
	
	var tablename=document.getElementById("listTable");
	var li=tablename.getElementsByTagName("tr");
	for (var i=0;i<=li.length;i++){
	if (i%2==0){
	li[i].style.backgroundColor="#f6f6f6";
	}else li[i].style.backgroundColor="#FFFFFF";
	}
});
//-->
</script>
<form action="" method="get" name="searchForm" id="searchForm">
	<input type="hidden" name="p" value="1" />
	
<div class='adduser'>
	<div class='adduser-left'><div class='adduser-icon'></div><span>财务收支</span></div>
</div>
<div class='querycondition'>
	<div class='condtiontitle'><div class='searchcondition'></div>搜索条件：</div>
	<div class='condtion'>
		账期： <input
				name="accountPeriod" type="text" id="accountPeriod"
				value="${formdata.accountPeriod}" size="20" />
		
		<input name="image" type="image" id="Image8" style="display:none" onmouseover="MM_swapImage('Image8','','${baseURL}/images/button_ss_a.jpg',1)" onmouseout="MM_swapImgRestore()" src="${baseURL}/images/button_ss.jpg"/>
	    <%-- <img src="${baseURL}/images/button_qk.jpg" name="clearButton" id="clearButton" style="cursor:pointer" onclick="clearInput()" onmouseover="MM_swapImage('clearButton','','${baseURL}/images/button_qk_a.jpg',1)" onmouseout="MM_swapImgRestore()"/>  --%>
		
		<input type='button' value='搜索'  class='button cyan medium' onclick="clickSS();">&nbsp;&nbsp;
		<input type='button' value='清空' class='button cyan medium' onclick="clearInput()">	
	</div>
	<div class='condtion'>
		开始时间：<input type="text" id="startDate" name="startDate" size="20" value="${formdata.startDate}" onclick="calendar.show(this);">
		结束时间：<input type="text" id="endDate" name="endDate" size="20" value="${formdata.endDate}" onclick="calendar.show(this);">
		
		<input type='button' value='计算'  class='button cyan medium' onclick="showStartEndDateDetail();">&nbsp;&nbsp;
	</div>
</div>
	<%-- <table width="98%" border="0" align="center" cellpadding="0"
		cellspacing="1">
		<tr>
			<td height="5" colspan="2"></td>
		</tr>

		<tr>
			<td height="20" align="left" valign="middle"><img
				src="${baseURL}/images/009.png" width="16" height="16"
				align="absmiddle" /> &nbsp;搜索条件：&nbsp;</td>
		</tr>
		<tr>
			<td height="20" align="left" valign="middle">账期： <input
				name="accountPeriod" type="text" class="button" id="accountPeriod"
				value="${formdata.accountPeriod}" size="20" />
				</td>
		</tr>
		<tr>
			<td height="20" align="center" valign="middle"><input
				name="image" type="image" id="Image8"
				onmouseover="MM_swapImage('Image8','','${baseURL}/images/button_ss_a.jpg',1)"
				onmouseout="MM_swapImgRestore()"
				src="${baseURL}/images/button_ss.jpg" /> &nbsp;&nbsp;&nbsp;&nbsp; <img
				src="${baseURL}/images/button_qk.jpg" name="clearButton"
				id="clearButton" style="cursor: pointer" onclick="clearInput()"
				onmouseover="MM_swapImage('clearButton','','${baseURL}/images/button_qk_a.jpg',1)"
				onmouseout="MM_swapImgRestore()" /></td>
		</tr>
		<tr>
			<td height="5" colspan="2"></td>
		</tr>
		<tr>
			<td height="1" colspan="2" bgcolor="#A6CAE8"></td>
		</tr>
		<tr>
			<td height="5" colspan="2" class="text_gray2"></td>
		</tr>
	</table> --%>
</form>
<script>
$("#supplierId").val("${formdata.supplierId}");

function clearInput() {
	$("#accountPeriod").val("");
	$("#supplierId").val("");
}

function selectAll(checkAllFlag) {
	var checkArray = document.getElementsByName("chk");
	for (var i = 0; i < checkArray.length; i++) {
		checkArray[i].checked = checkAllFlag;
	}
}

function showStartEndDateDetail(){
	var startDate = $("#startDate").val();
	var endDate = $("#endDate").val();
	$.layer({
	    type: 2,
	    maxmin: true,
	    shadeClose: true,
	    title: '每日账单',
	    shade: [0.1,'#fff'],
	    offset: [($(window).height() / 10)+'px',''],
	    area: ['800px', '400px'],
	    iframe: {src: '${ctx}/companyCountByDateAction/showStartEndDateDetail/' + startDate + "/" + endDate}
	}); 
}
</script>
<c:if test="${empty obj.list}">
	<div align="center">
		<b>没有符合条件的记录。</b>
	</div>
</c:if>
<c:if test="${not empty obj.list}">
<div class='userlist-title'>
	<div class='userlist-title-left'><div class='userlist-title-icon'></div><span>财务列表</span></div>
</div>
<div class='userlist'>
		<table width="100%" border="0" cellpadding="0" cellspacing="1"
		bgcolor="#FFFFFF" id="listTable">
								<tr align="center" bgcolor="#eeeeee">
									
									<td class='userlist-td operation' width="8%">账期</td>
									<td class='userlist-td operation' width="15%">供货商</td>
									<td class='userlist-td operation' width="12%">待支付金额</td>
									<td class='userlist-td operation' width="12%">已支付金额</td>
									<td class='userlist-td operation' width="12%">未支付金额</td>
									<td class='userlist-td operation' width="15%">时间</td>
									<td class='userlist-td operation' width="8%">备注</td>
								</tr>
								<c:forEach var="oneRow" items="${obj.list}">
									<tr align="center">
										
										<td class='userlist-td operation'>${oneRow.accountPeriod}</td>
										<td class='userlist-td operation' style="text-align:left;">${oneRow.supplierName}</td>
										<td class='userlist-td operation' style="text-align:right;">${oneRow.toPaid}</td>
										<td class='userlist-td operation' style="text-align:right;">${oneRow.hasPaid}</td>
										<td class='userlist-td operation' style="text-align:right;">${oneRow.unPaid}</td>
										<td class='userlist-td operation'><fmt:formatDate value="${oneRow.createTime}"
												pattern="yyyy-MM-dd HH:mm:ss" /></td>
										<td class='userlist-td operation'>${oneRow.remark}</td>
										
									</tr>
								</c:forEach>
							</table>
	<table>	
		<tr>
			<td height="25" colspan="2"><%@ include
					file="../include/listpage.jsp"%></td>
		</tr>
	</table>
</div>
</c:if>
<%@ include file="../include/bottom.jsp"%>